export function getUserInfo() {
  const userInfo = localStorage.getItem('userInfo')
  try {
    if (!userInfo) {
      return undefined
    }
    return JSON.parse(userInfo)
  } catch (error) {
    console.warn('getUserInfo', error)
    return undefined
  }
}

export function setUserInfo(userinfo) {
  window.localStorage.setItem('userInfo', JSON.stringify(userinfo))
}
